define(function(require, exports, module){
	exports.init = function(){
		var articleContentImgs = document.querySelectorAll('article img');
		for(var articleContentImg, article_imgContainer, i = 0, j = articleContentImgs.length; i < j; i++){
			articleContentImg = articleContentImgs[i];
			articleContentImg.style.width =  150 + 'px';
			articleContentImg.onClk(expandImg);
			article_imgContainer = articleContentImg.parentNode;
			
			clear(article_imgContainer);
			article_imgContainer.addCls('imgContainer');
			createExpand(article_imgContainer);
		}
	}
	function createExpand(article_imgContainer){
		var btn = document.createElement('div');
		btn.className = 'expandBtn state-small';
		
		article_imgContainer.appendChild(btn);
	}
	function clear(article_imgContainer){
		var clearEl = document.createElement('div');
		clearEl.className = 'clear';
		article_imgContainer.parentNode.insertBefore(clearEl, article_imgContainer.nextSibling);
	}
	function expandImg(e){
	//debugger;
		var img = e.currentTarget;
		var expendBtn = img.nextSibling.nextSibling;
		var article_imgContainer = img.parentNode;
		if(img){
			if(expendBtn.className.indexOf('state-small') != -1){
				img.origWidth = img.width;
				img.style.width = (document.documentElement.clientWidth - 80) + 'px' ;
				
				expendBtn.removeCls('state-small');
				article_imgContainer.style.width = 'auto';
			}else{
				img.style.width = img.origWidth + 'px';
				article_imgContainer.style.width = '150px';
				expendBtn.addCls('state-small');	
			}
		}else{
			console.log('找不到图片元素！');
		}
	}	
});